#ifndef __IDATABASE
#define __IDATABASE

//class QueryResult;

namespace Database
{
	enum DatabaseType
	{
		MySQL
	};

	class IDatabase abstract
	{
	public:
		//szHost: a host name or a ip Adress like "localhost" or "127.0.0.1"
		//szUser: login name like "root"
		//szPassword: the users password
		//szDatabase: the database (seriously)
		//port: port to connect on (default: 3306)
		//Returns true if connected otherwise false
		virtual bool Connect(std::string szHost, std::string szUser, std::string szPassword, std::string szDatabase, uint32 port) = 0;
		//Closes the connection
		virtual void Close() = 0;
		//szFrom: Base string wich will get escaped
		//Returns the escaped string
		virtual std::string EscapeString(std::string szFrom) = 0;
		//Returns the last MYSQL Error
		virtual std::string GetLastError() = 0;
		//szQuery: SQL query
		//Returns true if succesful otherwise false
		virtual bool Execute(std::string szQuery) = 0;
		//szQuery: SQL query
		//Returns a pointer to class IQueryResult
		virtual IQueryResult* Query(std::string szQuery, ...) = 0;

		//Need a workarround for this
		static IDatabase* CreateDatabase(DatabaseType type = MySQL);
	};
}

#endif